/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be.ac.ua.comp.projectGPT.BiddingPolicies;

/**
 * Implementation for a bidding policy on which the auctioneer depends.
 * The bid will be accepted when it is lower than a certain maximum.
 */
public class MaximumBidPolicy extends BiddingPolicy {

    long maximumBid;

    public MaximumBidPolicy(long maximumBid) {
        this.maximumBid = maximumBid;
    }

    public boolean accept(long bid, long previous) {
        return (bid < previous+maximumBid);
    }

    @Override
    public long getSuggestion(long previous) {
        return ((previous + maximumBid)-1);
    }

}
